<?php
    if(!$this->session->userdata('logged_in')) {
        redirect('logout');
    } else if($this->session->userdata('role') === 'viewer') {
        redirect('forbidden');
    }
?>

<div id="post_container">
        <?php $post_id = $draft['post_id']; ?>
        <?php echo form_open("post/draft/edit/$post_id", array('id' => 'approve_draft_form')); ?>
            <?php echo form_label('Title: ', 'content_title'); ?>
            <?php echo form_input($draft_title); ?><br/>
            <?php echo form_label('Summary', 'summary'); ?><br/>
            <?php echo form_textarea($summary); ?><br/>
            <?php echo form_label('Full Text', 'full_text'); ?><br/>
            <?php echo form_textarea($full_text); ?><br/>
            <input type="submit" name="save" value="Save" id="btn_submit" />
            <input type="submit" name="publish" value="Publish" id="btn_submit" />
            <input type="button" value="Cancel" id="post_cancel" onclick="window.location='<?php echo base_url() ?>post/draft/<?php echo $this->session->userdata('user_id');?>'" />
        <?php echo form_close(); ?>
</div>